﻿namespace App.Domain.Handlers {
    using App.Data;
    using App.Domain.Contracts;
    using App.Domain.Models;

    public class CreateCompany {
        private readonly ICompanyRepository _companyRepository;

        public CreateCompany(ICompanyRepository companyRepository) {
            _companyRepository = companyRepository;
        }

        public void Execute(ICreateCompanyCommand companyForm) {

            var company = companyForm.ConvertToEntity();
            _companyRepository.Create(company);
        }
    }
}
